package com.shadow.web.fore;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by qq65827 on 2015/1/25.
 */
@Controller
@RequestMapping("test")
public class testController {
    protected final static Logger logger = LoggerFactory.getLogger(testController.class);

    @RequestMapping("test")
    public String test(HttpServletRequest request,ModelMap modelMap) {
        System.out.println("say Hello ……");
        logger.info(request.getContextPath());
        String path=request.getContextPath();
        System.out.println("say Hello ……");
        modelMap.addAttribute("name", " World!");
        modelMap.addAttribute("path",path);
        return "test/test";
    }
}
